# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import databaseOperationConstants

class DatabaseOPerationSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(DatabaseOPerationSubDirectiveTree, self).__init__(parent)
        self.createDatabaseOperationTreeNode()

    def createDatabaseOperationTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "databaseOperation"
        self.setText(0,"数据库操作")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, databaseOperationConstants.DatabaseOperationConstants.connectingDatabaseDirective, "连接数据库")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, databaseOperationConstants.DatabaseOperationConstants.executingSQLDirective, "执行SQL语句")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, databaseOperationConstants.DatabaseOperationConstants.closingDatabaseDirective, "关闭数据库")
